<?php if(!defined('HDPHP_PATH'))EXIT;
$db->exe("DROP TABLE IF EXISTS `".$db_prefix."admin`");
$db->exe("CREATE TABLE `".$db_prefix."admin` (
  `uid` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `username` char(45) DEFAULT NULL,
  `password` char(40) DEFAULT NULL,
  `code` char(40) DEFAULT NULL,
  PRIMARY KEY (`uid`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8");
$db->exe("DROP TABLE IF EXISTS `".$db_prefix."category`");
$db->exe("CREATE TABLE `".$db_prefix."category` (
  `cid` smallint(5) unsigned NOT NULL AUTO_INCREMENT COMMENT '栏目id',
  `catname` char(50) NOT NULL DEFAULT '' COMMENT '栏目名',
  `pid` smallint(6) NOT NULL DEFAULT '0' COMMENT '父iID',
  `keywords` varchar(100) DEFAULT NULL COMMENT '关键字',
  `description` varchar(200) DEFAULT NULL COMMENT '详情',
  `list_tpl` varchar(255) DEFAULT 'list.html' COMMENT '列表页',
  `content_tpl` varchar(255) DEFAULT 'content.html' COMMENT '详情页',
  PRIMARY KEY (`cid`)
) ENGINE=MyISAM AUTO_INCREMENT=23 DEFAULT CHARSET=utf8 COMMENT='栏目表'");
$db->exe("DROP TABLE IF EXISTS `".$db_prefix."config`");
$db->exe("CREATE TABLE `".$db_prefix."config` (
  `id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
  `title` char(100) DEFAULT NULL,
  `name` varchar(45) DEFAULT NULL,
  `value` varchar(255) DEFAULT NULL,
  `type` enum('text','radio','textarea') NOT NULL,
  `info` varchar(255) NOT NULL,
  `orderlist` smallint(255) DEFAULT '100',
  `isshow` tinyint(255) DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8");
$db->exe("DROP TABLE IF EXISTS `".$db_prefix."content`");
$db->exe("CREATE TABLE `".$db_prefix."content` (
  `aid` int(11) NOT NULL AUTO_INCREMENT COMMENT '文章id',
  `title` char(100) DEFAULT NULL COMMENT '文章标题',
  `content` text COMMENT '文章内容',
  `addtime` int(10) DEFAULT NULL COMMENT '发布时间',
  `click` mediumint(8) unsigned DEFAULT NULL COMMENT '点击次数',
  `thumb` varchar(255) DEFAULT NULL,
  `keywords` varchar(100) DEFAULT NULL,
  `description` varchar(200) NOT NULL,
  `cid` smallint(5) unsigned NOT NULL,
  PRIMARY KEY (`aid`),
  KEY `fk_xn_content_xn_category_idx` (`cid`)
) ENGINE=MyISAM AUTO_INCREMENT=15 DEFAULT CHARSET=utf8 COMMENT='文章表'");
